package com.ssy.lingxi.search.api.feign;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.search.api.hystrix.PurchaseHystrix;
import com.ssy.lingxi.search.api.model.request.SimpleIdListRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 进货单服务类
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/8/1
 */
@FeignClient(value = "search-service", fallback = PurchaseHystrix.class)
public interface IPurchaseFeign {

    /**
     * 删除进货单--会员商品
     * @param simpleIdListRequest
     * @return
     */
    @RequestMapping(value = "/search/shop/purchase/deletePurchase", method = RequestMethod.POST)
    Wrapper<String> deletePurchase(@RequestBody SimpleIdListRequest simpleIdListRequest);

    /**
     * 删除进货单--渠道商品
     * @param simpleIdListRequest
     * @return
     */
    @RequestMapping(value = "/search/shop/purchaseChannel/deletePurchase", method = RequestMethod.POST)
    Wrapper<String> deletePurchaseChannel(@RequestBody SimpleIdListRequest simpleIdListRequest);

    /**
     * 查询会员在商城的进货单里面商品的数量
     */
    @RequestMapping(value = "/search/shop/purchase/getPurchaseCommodityCount", method = RequestMethod.GET)
    Wrapper<Double> getPurchaseCommodityCount(@RequestParam("shopId") Long shopId, @RequestParam("memberId") Long memberId, @RequestParam("memberRoleId") Long memberRoleId, @RequestParam("commoditySkuId") Long commoditySkuId);
}
